package com.qianying.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

/**
 * 系统角色实体类
 * 映射数据库中的sys_role表
 */
@Data
@TableName("sys_role")
@Schema(description = "系统角色表实体类，存储系统角色相关信息")
public class SysRole {

    @TableId(value = "id", type = IdType.AUTO)
    @Schema(description = "主键ID，自增", example = "1")
    private Long id;

    @TableField("role_name")
    @Schema(description = "角色名称(汉字)", required = true, example = "系统管理员")
    private String roleName;

    @TableField("role_desc")
    @Schema(description = "角色描述", required = true, example = "拥有系统全部操作权限")
    private String roleDesc;

    @TableField("role_code")
    @Schema(description = "角色的英文code.如：ADMIN", required = true, example = "ADMIN")
    private String roleCode;

    @TableField("sort")
    @Schema(description = "角色顺序", example = "1")
    private Integer sort;

    @TableField("status")
    @Schema(description = "是否禁用，0:启用(否）,1:禁用(是)", example = "0")
    private Integer status;

    // 非数据库字段，用于状态名称展示
    @TableField(exist = false)
    @Schema(description = "状态名称（非数据库字段，用于显示）", example = "启用")
    private String statusName;
}
